/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Dragon License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.Dragon.com/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.dragon.service.impl;

import java.io.Serializable;
import java.util.List;

import com.dragon.hibernate.dao.IDao;
import com.dragon.service.IService;


/**
 * @author Dragon Li
 * 2013-3-22 下午4:53:02
 * version v0.1
 */
public class Service implements IService {
	
	
	private IDao dao;
	
	
	public void setDao(IDao dao) {
		this.dao = dao;
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#get(java.io.Serializable, java.lang.Class)
	 */
	@Override
	public Object get(Serializable id, Class entityClass) {
		// TODO Auto-generated method stub
		return this.dao.get(id, entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#load(java.io.Serializable, java.lang.Class)
	 */
	@Override
	public Object load(Serializable id, Class entityClass) {
		// TODO Auto-generated method stub
		return  this.dao.load(id, entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#get(java.io.Serializable[], java.lang.Class)
	 */
	@Override
	public List get(Serializable[] ids, Class entityClass) {
		// TODO Auto-generated method stub
		return  this.dao.get(ids, entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#get(java.lang.String, java.lang.Object, java.lang.Class)
	 */
	@Override
	public Object get(String propertyName, Object value, Class entityClass) {
		// TODO Auto-generated method stub
		return  this.dao.get(propertyName, value, entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#getList(java.lang.String, java.lang.Object, java.lang.Class)
	 */
	@Override
	public List getList(String propertyName, Object value, Class entityClass) {
		// TODO Auto-generated method stub
		return  this.dao.getList(propertyName, value, entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#getAll(java.lang.Class)
	 */
	@Override
	public List getAll(Class entityClass) {
		// TODO Auto-generated method stub
		return  this.dao.getAll(entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#isExist(java.lang.String, java.lang.Object, java.lang.Class)
	 */
	@Override
	public boolean isExist(String propertyName, Object value, Class entityClass) {
		// TODO Auto-generated method stub
		return  this.dao.isExist(propertyName, value, entityClass);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#save(java.io.Serializable)
	 */
	@Override
	public Serializable save(Serializable object) {
		// TODO Auto-generated method stub
		return  this.dao.save(object);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#update(java.io.Serializable)
	 */
	@Override
	public void update(Serializable object) {
		// TODO Auto-generated method stub
		 this.dao.update(object);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#delete(java.io.Serializable)
	 */
	@Override
	public void delete(Serializable object) {
		// TODO Auto-generated method stub
		 this.dao.delete(object);
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#delete(java.io.Serializable, java.lang.Class)
	 */
	@Override
	public void delete(Serializable id, Class entityClass) {
		// TODO Auto-generated method stub
		 this.dao.delete(id, entityClass);
		
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#delete(java.io.Serializable[], java.lang.Class)
	 */
	@Override
	public void delete(Serializable[] ids, Class entityClass) {
		// TODO Auto-generated method stub
		 this.dao.delete(ids, entityClass);
		
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#flush()
	 */
	@Override
	public void flush() {
		 this.dao.flush();
		
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#clear()
	 */
	@Override
	public void clear() {
		 this.dao.clear();
		
	}

	/* (non-Javadoc)
	 * @see com.dragon.service.IService#evict(java.lang.Object)
	 */
	@Override
	public void evict(Object object) {
		 this.dao.evict(object);
		
	}

}
